package com.ruoyi.airspaceFlight.controller;


import com.ruoyi.airspaceFlight.domain.AirspaceApply;


import com.ruoyi.airspaceFlight.dto.req.FlightStatisticsDto;
import com.ruoyi.airspaceFlight.dto.req.RegisterStaisticsDto;
import com.ruoyi.airspaceFlight.dto.req.ViolationStatisticsDto;
import com.ruoyi.airspaceFlight.dto.resp.FlightStatisticsVo;
import com.ruoyi.airspaceFlight.dto.resp.RegisterStaisticsVo;
import com.ruoyi.airspaceFlight.dto.resp.ViolationStatisticsVo;
import com.ruoyi.airspaceFlight.service.StatisticsService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 统计Controller
 * @author zc
 * @date 2023-11-10
// */
@RestController
@RequestMapping("/statistics")
public class StatisticsController extends BaseController {

    @Autowired
    private StatisticsService statisticsService;

    /**
     * 飞行计划统计
     * @param flightStatisticsDto
     * @return
     */
    @PostMapping("/flyplain/list")
    public TableDataInfo list(FlightStatisticsDto flightStatisticsDto)
    {
        startPage();
        List<FlightStatisticsVo> list = statisticsService.selectflightStatisticsList(flightStatisticsDto);
        return getDataTable(list);
    }

    /**
     * 违规统计
     * @param violationStatisticsDto 违规飞行统计
     * @return
     */
    @PostMapping("/violationfly/list")
    public TableDataInfo list(ViolationStatisticsDto violationStatisticsDto)
    {
        startPage();
        List<ViolationStatisticsVo> list = statisticsService.selectViolationStatisticsList(violationStatisticsDto);
        return getDataTable(list);
    }

    /**
     * 注册统计
     * @param registerStaisticsDto
     * @return
     */
    @PostMapping("/register/list")
    public TableDataInfo list(RegisterStaisticsDto registerStaisticsDto)
    {
        startPage();
        List<RegisterStaisticsVo> list = statisticsService.selectRegisterStatisticsList(registerStaisticsDto);
        return getDataTable(list);
    }


}
